package com.example.libo.huihui.utils;

import android.databinding.BindingAdapter;
import android.widget.ImageView;

import com.squareup.picasso.Picasso;

/**
 * Created by libo on 2017/1/11.
 */

public class LoadImage {
    /**
     * 当这个属性以正确的类型设置到布局文件中时，dataBinding框架会触发被注解的方法,必须是static的
     */
    @BindingAdapter({"imageUrl"})  //binddingadapter注解框架自定义了imageUrl属性，会调用loadImageView()方法
    public static void loadImage(ImageView view,String url){
        Picasso.with(view.getContext())
               .load(url)
               .into(view);
    }
}
